const vm = new Vue({
    el: '#main',
    data: {
        cmtList: [],
        role: fxj.getSearch().get('role'), // 1 是房东,2是房客
    },
    methods: {
        goCommentDetail,
    },
});

function apiready() {
    fxj.fixLayout();
    reqCommentList();
}

function goCommentDetail(commentId) {
    goPage('comment_detail.html', {
        data: {
            id: commentId,
            type: '1',
        },
    });
}

async function reqCommentList() {
    const res = await ajax({
        url: 'home/userComment/getCommentList',
        data: {
            role: vm.role === '2' ? -1 : 1, // -1是房客,1是房东
        },
    });
    /* status 6 是房客已评论,7 是房东已评论, 8是双方已评论
    * */
    vm.cmtList = res.data;
}

